{extend name="public/base"/}
{block name="body"}
<div class="main-box clearfix">
	<header class="main-box-header clearfix">
		<div class="pull-left">
			<h2>{$meta_title}</h2>
		</div>
	</header>
	<div class="main-box-body clearfix">
		<div class="row">
			<form method="get">
				<div class="col-sm-12 col-md-4 col-lg-3">
					<input type="text" class="form-control" name="keyword" value="{$keyword|default=''}" placeholder="请输入关键字">
				</div>
				{if isset($cate_list)}
				<div class="col-sm-12 col-md-4 col-lg-3">
					<select name="category" id="category" class="form-control">
						<option value="">请选择栏目</option>
						{volist name="cate_list" id="item"}
						<option value="{$item['id']}" {if isset($category) && $item['id'] == $category}selected{/if}>{$item['title_show']}</option>
						{/volist}
					</select>
				</div>
				{/if}
				<div class="col-sm-12 col-md-4">
					<button class="btn btn-primary" type="submit">搜索</button>
				</div>
			</form>
		</div>
		<div class="table-responsive clearfix">

			<div class="table-responsive clearfix">
				<table class="table table-hover">
					<thead>
						<tr>
							<th>产品名称</th>
							<th>产品单价</th>
							<th>产品库存</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody>
						{if condition="empty($list)"}
						<tr>
							<td colspan="{$cow}" align="center">暂无数据！</td>
						</tr>
						{else/}
						{volist name="list" id="item"}
						<tr>
							<td>{$item['title']}</td>
							<td>{$item['price']}</td>
							<td>{$item['stock']}</td>
							<td>
								{if $operate=='add'}
								<a href="{:url('admin/pro/add',array('id'=>$item['id']))}" >增加库存</a>
								{elseif $operate=='reduce'}
								<a href="{:url('admin/pro/reduce',array('id'=>$item['id']))}" >减少库存</a>
								{else/}
								<a href="{:url('admin/pro/inventory',array('id'=>$item['id']))}" >盘点</a>
								{/if}
							</td>
						</tr>
						{/volist}
						{/if}
					</tbody>
				</table>
			</div>
			{$page}
		</div>
	</div>
</div>
{/block}